<script setup lang='ts'>
const props = defineProps({
  car: String,
  changeCarCb: Function
})
console.log(props.car)
const emit = defineEmits(['changeCar'])
</script>

<template>
  <div style="width: : 300px; height: 200px; border: 10px solid #ff0000">
    子组件
    <div>车： {{ car }}</div>
    <button @click="emit('changeCar', '法拉利')">换车</button>
    <button @click="changeCarCb('兰博基尼')">换车(方式2)</button>
  </div>
</template>

<style scoped></style>
